#! /bin/bash

cscope_file="cscope.files"
lookup_file="lookup.files"
PROJECT_PATH="`pwd`" 

find $PROJECT_PATH -name \*.c -o -name \*.cpp -o -name \*.cc -o -name \*.h -o -name \*.hh > $cscope_file

#cscope -bRq -i $cscope_file 2&>/dev/null
cscope -bRq -i$cscope_file $PROJECT_PATH 2&>/dev/null

#ctags -R * 2&>/dev/null
ctags -R --fields=+lS $PROJECT_PATH 2&>/dev/null

#(echo "!_TAG_FILE_SORTED	2	/2=foldcase/";(find . -type f -printf "%f\t%p\t1\n" | \
#         sort -f)) > ./filenametags
#find . -not -iname "*.class" -type f -printf "%f\t%p\t1\n" \
echo "!_TAG_FILE_SORTED	2	/2=foldcase/" > $lookup_file 
find  $PROJECT_PATH \( -name .git -o -name .svn -o -path ./classes \) -prune -o -not -iregex '.*\.\(jar\|gif\|jpg\|class\|exe\|dll\|pdd\|sw[op]\|xls\|doc\|pdf\|zip\|tar\|ico\|ear\|war\|dat\).*' -type f -printf "%f\t%p\t1\n"| sort -f >> $lookup_file

